package com.nf.db.handler.property;

import com.nf.db.PropertyHandler;

import java.sql.Date;
import java.time.LocalDate;

public class LocalDatePropertyHandler implements PropertyHandler {
    @Override
    public boolean match(Class<?> beanFieldClz, Object value) {
        return value instanceof Date && beanFieldClz == LocalDate.class;
    }

    @Override
    public Object handle(Class<?> beanFieldClz, Object value) {
        return ((Date) value).toLocalDate();
    }
}
